


  undef("gsw")

;;------------------------------------------------------
;; gaussian weights 
;; function called: latGauWgt (NCL lib)  
;;------------------------------------------------------

  function gsw(nn)

  begin

 
   if ("old".eq."not used any more") then 
      x1 = (/ 0.000793, 0.001853, 0.002909, 0.003966, 0.005015, 0.006059, \
              0.007097, 0.008127, 0.009148, 0.010161, 0.011162, 0.012152, \
              0.013128, 0.014091, 0.015039, 0.015971, 0.016886, 0.017783, \
              0.018661, 0.019519, 0.020357, 0.021173, 0.021967, 0.022737, \
              0.023483, 0.024205, 0.024901, 0.025570, 0.026212, 0.026827, \
              0.027413, 0.027971, 0.028498, 0.028995, 0.029461, 0.029897, \
              0.030300, 0.030671, 0.031010, 0.031316, 0.031589, 0.031829, \
              0.032035, 0.032207, 0.032344, 0.032447, 0.032517, 0.032551 /)
      nx = dimsizes(x1)  
      x2 = x1(::-1)
      x3 = new(2*dimsizes(x1),"float") 
      x3( 0:  nx-1) = x1(:) 
      x3(nx:2*nx-1) = x2(:) 

   end if 



   if (nn.eq.21) then
    nlat = 32 
   end if

   if (nn.eq.31) then
    nlat = 48
   end if

   if (nn.eq.42) then 
    nlat = 64  
   end if 

   if (nn.eq.63) then
    nlat = 96  
   end if

   if (nn.eq.85) then
    nlat = 128
   end if

   if (nn.eq.106) then
    nlat = 160 
   end if

   if (nn.eq.159) then
    nlat = 240  
   end if

   if (nn.eq.319) then
    nlat = 320 
   end if


   gw = latGauWgt(nlat, "lat", "gaussian weights", "dimension_less")

   return(gw)

  end


